package com.example.perplonews.a_c_network

import com.example.shopping2.a_a_entity.BaseEntity
import com.example.shopping2.a_a_entity.TokenEntity
import com.example.shopping2.a_c_fragment.car.entity.CarList_Entity
import com.example.shopping2.a_c_fragment.car.entity.OrderGoodsEntity
import com.example.shopping2.a_c_fragment.car.entity.ShipAddressEntity
import com.example.shopping2.a_c_fragment.car.entity.SubCarEntity
import com.example.shopping2.a_c_fragment.classa.entity.ClassRight_Entity
import com.example.shopping2.a_c_fragment.classa.entity.Classleft_Entity
import com.example.shopping2.a_c_fragment.home.entity.HomeGoodsEntity
import com.example.shopping2.a_c_fragment.main.entity.greendao.UserValue
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.POST


interface Api {
    @POST("sysToken/getToken")
    fun requestToken(@Body body:RequestBody):Observable<TokenEntity>

    @POST("goods/getGoodsList")
    fun requestHomeGoods(@Body body: RequestBody): Observable<HomeGoodsEntity>

    @POST("cart/add")
    fun requestAddCar(@Body body: RequestBody): Observable<BaseEntity>

    @POST("category/getCategory")
    fun requestClassValue(@Body body: RequestBody): Observable<Classleft_Entity>

    @POST("category/getCategory")
    fun requestClassValue2(@Body body: RequestBody): Observable<ClassRight_Entity>

    @POST("userCenter/login")
    fun requestLogin(@Body body: RequestBody):Observable<UserValue>

    //获取购物车列表
    @POST("cart/getList")
    fun requestCarList(@Body body: RequestBody?): Observable<CarList_Entity>

    //购物车提交订单
    @POST("cart/submit")
    fun requestSubCar(@Body body: RequestBody?): Observable<SubCarEntity>

    //获取订单详情
    @POST("order/getOrderById")
    fun requestGetOrder(@Body body: RequestBody?): Observable<OrderGoodsEntity>

    //收货地址列表
    @POST("shipAddress/getList")
    fun requestAddressList(@Body body: RequestBody?): Observable<ShipAddressEntity>

    //添加收货地址
    @POST("shipAddress/add")
    fun requestAddAddress(@Body body: RequestBody?): Observable<BaseEntity>

    //修改收货地址
    @POST("shipAddress/modify")
    fun requestUpdateAddress(@Body body: RequestBody?): Observable<BaseEntity>


    //删除收货地址
    @POST("shipAddress/delete")
    fun requestDelAddress(@Body body: RequestBody?): Observable<BaseEntity>





}